import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xindong/manager/xindong_audio_ctr.dart';
import 'package:xindong/manager/xindong_chat_singleton.dart';
import 'package:xindong/manager/xindong_notice_ctr.dart';
import 'package:xindong/manager/xindong_permission_ctr.dart';
import 'package:xindong/routes/account/controller/xindong_login_ctr.dart';
import 'package:xindong/routes/account/controller/xindong_register_ctr.dart';
import 'package:xindong/routes/call/controller/xindong_call_controller.dart';
import 'package:xindong/routes/call/controller/xindong_call_rtc_controller.dart';
import 'package:xindong/routes/tab_chats/controller/xindong_liaotian_vm.dart';
import 'package:xindong/routes/tab_chats/controller/xindong_intimate_vm.dart';
import 'package:xindong/routes/tab_chats/controller/xindong_message_vm.dart';
import 'package:xindong/routes/tab_moments/controller/xindong_dongtai_actions_ctr.dart';
import 'package:xindong/routes/user/auth/xindong_auth_ctr.dart';
import 'package:xindong/routes/user/noble/xindong_noble_ctr.dart';
import 'package:xindong/routes/user/wallet/xindong_recharge_ctr.dart';
import 'package:xindong/routes/user/wallet/xindong_wallet_ctr.dart';
import 'package:xindong/widgets/common/xindong_app_bar.dart';
import 'package:xindong/widgets/floating_screen/xindong_piao_ping_singleton.dart';
import 'package:xindong/widgets/video/xindong_common_video_list_ctr.dart';
import 'package:xindong/widgets/xindong_countdown_button.dart';

import 'manager/xindong_hello_ctr.dart';
import 'manager/xindong_yinsi_singleton.dart';
import 'manager/xindong_gift_animation_ctr.dart';
import 'manager/xindong_user_controller.dart';

class XinDongGetXBangDing implements Bindings {
  @override
  void dependencies() {
    // 只有一个页面用到可在用到页面注册
    // tag：标签，用于区分同一个类不同实例。
    // fenix：类似'永久'，不同的是，当不使用时，实例会被丢弃，但当再次需要使用时，Get会重新创建实例
    // permanent：是否永久，默认 false 当实例不再使用时会进行销毁，true 则会一直保留
    Get.lazyPut(() => XinDongYinSiSingleton(), fenix: true); // 协议
    Get.lazyPut(() => XinDongLoginCtr(), fenix: true); // 登录
    Get.lazyPut(() => XinDongRegisterCtr(), fenix: true); // 注册
    Get.lazyPut(() => XinDongCountdownButtonCtr(), fenix: true); // 验证码

    Get.lazyPut(() => XinDongDongTaiActionsCtr(), fenix: true); // 动态操作
    Get.lazyPut(() => XinDongPermissionCtr(), fenix: true); // 权限操作
    // Get.lazyPut(() => XinDongPublishController(), fenix: true); // 发布

    // Chat
    Get.lazyPut(() => XinDongLiaoTianVM(), fenix: true);
    Get.lazyPut(() => XinDongIntimateVM(), fenix: true);
    Get.lazyPut(() => XinDongMessageVM(), fenix: true);
    Get.lazyPut(() => XinDongGiftAnimationCtr(), fenix: true); // 礼物动效
    Get.lazyPut(() => XinDongChatSingleton.instance, fenix: true); // 飘飘
    Get.lazyPut(() => XinDongPiaoPingSingleton.instance, fenix: true); // 飘飘

    // 永久不销毁的
    GetInstance().lazyPut(() => XinDongUserController(), permanent: true); // 我的
    GetInstance().lazyPut(() => XinDongCallController(), permanent: true);
    GetInstance().lazyPut(() => XinDongCallRTCController(), permanent: true);
    GetInstance().lazyPut(() => XinDongAuthCtr(), permanent: true); // 认证操作
    GetInstance().lazyPut(() => XinDongAudioCtr(), permanent: true); // 音频
    GetInstance().lazyPut(() => XinDongHelloCtr(), permanent: true); // 打招呼
    GetInstance().lazyPut(() => XinDongWalletCtr(), permanent: true); // 钱包
    GetInstance().lazyPut(() => XinDongRechargeCtr(), permanent: true); // 充值数据
    GetInstance().lazyPut(() => XinDongNobleCtr(), permanent: true); // 会员数据
    GetInstance().lazyPut(() => XinDongNoticeCtr(), permanent: true); // 会员数据
    GetInstance().lazyPut(() => XinDongCommonVideoListCtr(), permanent: true); // 视频
  }
}

class XinDongGetXNotFoundYeMian extends StatelessWidget {
  final String title;

  const XinDongGetXNotFoundYeMian({Key? key, required this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: XinDongAppBar(title),
      body: const Center(
        child: Text("程序员正在开发中，敬请期待！", style: TextStyle(fontSize: 20), textAlign: TextAlign.center),
      ),
    );
  }
}
